//
//  GYPayMethodTableViewCell.m
//  GoodLuck
//
//  Created by apple on 2018/4/4.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

static NSString *payMethodCellIdentifier = @"payMethodCellIdentifier";

#import "GYPayMethodTableViewCell.h"

@interface GYPayMethodTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *payImageView;
@property (weak, nonatomic) IBOutlet UILabel *payNameLable;
@property (weak, nonatomic) IBOutlet UIImageView *paySelectState;

@end
@implementation GYPayMethodTableViewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    GYPayMethodTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:payMethodCellIdentifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] firstObject];
    }
    
    return cell;
}

- (void)setPayment:(GYPayment *)payment {
    _payment = payment;
    
    switch ([payment.payment_id intValue]) {
        case 1:
        {
            self.payImageView.image = [UIImage imageNamed:@"zhifubao"];
        }
            break;
            
        case 2:
        {
            self.payImageView.image = [UIImage imageNamed:@"weixin"];
        }
            break;
            
        default:
        {
            self.payImageView.image = [UIImage imageNamed:@"4"];
        }
            break;
    }
    
    self.payNameLable.text = payment.payment_name;
    self.paySelectState.highlighted = payment.isSelected;
    
    
}
@end
